import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
import './assets/css/icon.css'
import '@/assets/css/common.scss' 
import '@/assets/css/reset.css' 
import 'default-passive-events'
import directive from './directive' //directive
// import './permission' // permission control

import * as echarts from 'echarts'
Vue.prototype.$echarts = echarts
// 全局方法引入
import { resetForm, download, parseTime, handleTree, addDateRange } from "@/utils/tool";
import { CreditCodeValid } from "@/utils/creditCode";
// 全局组件引入
import RightToolbar from "@/components/RightToolbar"
import Pagination from "@/components/Pagination";
import imagePreview from "@/components/ImagePreview";


Vue.use(directive)


Vue.use(ElementUI);
Vue.config.productionTip = false

// 全局方法挂载
Vue.prototype.resetForm = resetForm
Vue.prototype.download = download
Vue.prototype.parseTime = parseTime
Vue.prototype.handleTree = handleTree
Vue.prototype.addDateRange = addDateRange
Vue.prototype.creditCodeValid = CreditCodeValid
Vue.prototype.msgSuccess = function (msg) {
  this.$message({ showClose: true, message: msg, type: "success" });
}
Vue.prototype.msgError = function (msg) {
  this.$message({ showClose: true, message: msg, type: "error" });
}
Vue.prototype.msgInfo = function (msg) {
  this.$message.info(msg);
}

// 全局组件挂载
Vue.component('Pagination', Pagination)
Vue.component('RightToolbar', RightToolbar)
Vue.component('imagePreview', imagePreview)

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
